Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development


Defining rules that use your own functions and properties

You can define new properties or functions to use in your own action rules, if existing ones are not sufficient to express the criteria you need to enable and disable, hide and view, or change the image on toolbar items. In particular, if your application logic needs to perform some fairly specific or complex operation to determine the proper state of toolbar items, you might want to define a function that does the calculation and returns TRUE or FALSE accordingly. This is similar to the modifyDisabledActions discussion and example earlier in this chapter.

If you are modifying the behavior of existing buttons, such as the TableIO buttons that are used throughout the framework, it is almost certainly not a good idea to change the definitions of their rules in the Toolbar and Menu Designer. In fact, one of the key points you must keep in mind when you define action rules is that all of the elements of the rule must be available for evaluation anywhere the item is used. If the property or function is not defined, it will be considered to be FALSE, which means for example that an enable rule with such an expression would never be TRUE and the button would never be enabled anywhere in the framework or any application module where it is used.

It is more appropriate to define action rules for new toolbar items you create for your application. Then you can associate whatever properties and functions you need, as long as you are sure they will be available to evaluate wherever the item is used.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095